
import 'package:basic_common/common_exports.dart';
import 'package:basic_team/model/team_member_data.dart';

class TeamMemberController extends GetxController {
  final memberList = <TeamMemberList>[].obs;

  /// 团队成员列表
  void getMemberList(String teamNo) async {
    HttpData res = await ApiService().getTeamMember(data: {"teamNo": teamNo});
    if (res.code == 1) {
      TeamMemberData teamMemberData = TeamMemberData.fromJson(res.data);
      memberList.value = teamMemberData.list!;
    }
    update(['memberList']);
  }

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    String teamNo = Get.arguments['teamNo'];
    getMemberList(teamNo);
  }
}
